package com.pro.controller;

import com.pro.domain.Theather;
import com.pro.service.TheatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
public class TheaterController {
    @Autowired
    private TheatherService theatherService;
    //获取所有电影信息
    @CrossOrigin
    @RequestMapping("/selectallMovie")
    @ResponseBody
    public List<Theather> selectAll(){
        List<Theather> list = theatherService.selectallMovie();
        return list;
    }
    @CrossOrigin
    @RequestMapping("/selectMovieByName")
    @ResponseBody
    public List<Theather> selectMovieByName(String theatername){
        List<Theather> list = theatherService.selectMovieByName(theatername);
        return list;
    }
}
